//
//  SubTagCell.m
//  Budejie
//
//  Created by 远成物流 on 2017/6/1.
//  Copyright © 2017年 陈梦佳. All rights reserved.
//

#import "SubTagCell.h"
#import "UIImageView+Download.h"
#import "SubTagModel.h"

@interface SubTagCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconImg;
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (weak, nonatomic) IBOutlet UILabel *numberLab;

@end

@implementation SubTagCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setModel:(SubTagModel *)model{
    _model = model;
    
    [_iconImg setImageWithUrl:model.image_list];
    
    _nameLab.text = model.theme_name;
    
    NSInteger num = model.sub_number.integerValue;
    if (num>=10000) {
        _numberLab.text = [NSString stringWithFormat:@"%.1f万人订阅",num/10000.0];
        _numberLab.text = [_numberLab.text stringByReplacingOccurrencesOfString:@".0" withString:@""];
    }
    
    _numberLab.text = [NSString stringWithFormat:@"%@人订阅",model.sub_number];
}

-(void)setFrame:(CGRect)frame{
    frame.size.height -= 1;
    
    // 才是真正去给cell赋值
    [super setFrame:frame];
}

@end
